<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>亿乐购后台管理系统</title>
    <link rel="stylesheet" href="/wcs/Public/admin/css/pintuer.css">
    <link rel="stylesheet" href="/wcs/Public/admin/css/admin.css">
    <link rel="stylesheet" href="/wcs/Public/admin/css/user.css">
    <script src="/wcs/Public/admin/js/jquery.js"></script>
    <script src="/wcs/Public/admin/js/pintuer.js"></script>
    <script src="/wcs/Public/admin/js/respond.js"></script>
    <script src="/wcs/Public/admin/js/admin.js"></script>

    <script type="text/javascript">
    function repassw(){
    	//判断两个密码是否一致
        if($("input[name='password']").val()!=$("input[name='repassword']").val()){
			$("#repassword").html("<ul><li><a style='color:red;'>两个密码不一致！</a></ul></li>");
			return false;
        }else{
        	$("#repassword").html("");
        	return true;
        }
    }
	//分页ajax
    //分页ajax
    function ajaxpage($page){
    	$.ajax( {    
    	    url:"<?php echo U('admin/user/ajaxpage');?>",// 跳转到 action    
    	    data:{
    	    	p:$page
    	    },    
    	    type:'get',    
    	    dataType:'json',
    	    beforeSend:function(XMLHttpRequest){
    	    	$("#ajaxpagedata").html("正在加载中。。。");
        	 },    
    	    success:function(data) {
				$("#ajaxpagehtml").html(data.show);
          	    var pagehmtl="<table class='table table-hover'><tr><th>用户名称</th><th>用户密码</th><th>手机号</th><th>邮箱</th><th>地址</th><th>编辑</th><th>删除</th></tr>";
				var list=data.list;
	      		for(var i=0; i<list.length; i++)  
	   		    {  
		   		    pagehmtl+="<tr><th>"+list[i].name+"</th><th>"+list[i].password+"</th><th>"+list[i].tel+"</th><th>"+list[i].email+"</th><th>"+list[i].address+"</th><th><a href='#'>编辑</a></th><th><a href='#'>删除</a></th></tr>";  
	   		    }
	      		pagehmtl+="</table>"; 
        	    $("#ajaxpagedata").html(pagehmtl);      
    	     },    
    	     error : function() {
    	    	 $("#ajaxpage").html('加载数据失败！');    
    	     }    
    	});
    }
    </script>
</head>

<body>
<div class="lefter">
    <div class="logo"><a href="#" ><img src="/wcs/Public/admin/images/logo.png" alt="亿乐购后台管理系统" /></a></div>
</div>
<div class="righter nav-navicon" id="admin-nav">
    <div class="mainer">
        <div class="admin-navbar">
            <span class="float-right">
            	<a class="button button-little bg-main" href="<?php echo U('admin/index/index');?>" >前台首页</a>
                <a class="button button-little bg-yellow" href="<?php echo U('admin/login/logout');?>">注销登录</a>
            </span>
            <ul class="nav nav-inline admin-nav">
                <li><a href="<?php echo U('admin/index/index');?>" class="icon-home"> 开始</a>
                    <ul><li><a style="font-weight:bold;" href="#" > 开始 </a></li><li  class="active"><a href="#" > 系统消息 </a></li></ul>
                </li>
                <li  class="active"><a href="<?php echo U('admin/user/index');?>" class="icon-shopping-cart"> 用户管理 </a>
            		<ul><li><a style="font-weight:bold;" href="#" > 用户管理 </a></li><li  class="active"><a href="<?php echo U('admin/user/index');?>"> 普通用户 </a></li><li><a href="<?php echo U('admin/manager/index');?>">产品管理员</a></li><li><a href="<?php echo U('admin/admin/index');?>">系统管理员</a></li><li><a href="#"> 会员设置 </a></li><li><a href="#"> 积分设置 </a></li></ul>
                </li>
                <li><a href="<?php echo U('admin/pclass/index');?>" class="icon-shopping-cart"> 分类管理 </a>
					<ul><li><a style="font-weight:bold;" href="#" > 分类管理 </a></li><li><a href="#"> 分类管理  </a></li><li class="active"><a href="#"> 子分类  </a></li></ul>
                </li>
                <li><a href="<?php echo U('admin/product/index');?>" class="icon-shopping-cart"> 产品管理  </a>
					<ul><li><a style="font-weight:bold;" href="#" > 产品管理 </a></li><li><a href="#"> 产品添加  </a></li><li class="active"><a href="#"> 产品编辑  </a></li></ul>
                </li>
                <li><a href="<?php echo U('admin/order/index');?>" class="icon-shopping-cart"> 订单管理  </a>
					<ul><li><a style="font-weight:bold;" href="#" > 订单管理 </a></li><li><a href="#"> 订单管理  </a></li><li class="active"><a href="#"> 产品编辑  </a></li></ul>
                </li>
                <li><a href="<?php echo U('admin/statistic/index');?>" class="icon-shopping-cart"> 统计  </a>
					<ul><li><a style="font-weight:bold;" href="#" > 统计 </a></li><li><a href="#"> 订单统计  </a></li><li class="active"><a href="#"> 产品统计  </a></li><li class="active"><a href="#"> 用户统计  </a></li></ul>
                </li>
                <li><a href="<?php echo U('admin/Channel/index');?>" class="icon-shopping-cart"> 渠道管理  </a>
					<ul><li><a style="font-weight:bold;" href="#" > 渠道管理 </a></li><li><a href="#"> 添加渠道  </a></li><li class="active"><a href="#"> 渠道编辑  </a></li></ul>
                </li>
            </ul>
        </div>
        <div class="admin-bread">
            <span>您好，<a style="color:red;"><?php echo ($_SESSION['user']['name']); ?></a> ，欢迎您的光临。</span>
            <ul class="bread">
                <li><a href="<?php echo U('admin/index/index');?>" class="icon-home"> 开始</a></li>
                <li>后台首页</li>
            </ul>
        </div>
    </div>
</div>

<div class="admin">

    <div class="tab">
      <div class="tab-head">
        <strong>普通用户管理</strong>
        <ul class="tab-nav">
          <li class="active"><a href="#tab-set">添加用户</a></li>
          <li><a href="#tab-email">编辑用户</a></li>
        </ul>
      </div>
      <div class="tab-body">
        <br />
        <div class="tab-panel active" id="tab-set">
        <div id="alermsn" style="display:none;" ></div>
		<form class="form-x" action="<?php echo U('admin/user/add');?>" method="post" onsubmit="return repassw()">
        	<div style="width:700px;">
	            <div class="form-group">
	            	<div class="label"><label for="title">账号</label></div>
	                <div class="field field-icon-right">
	                    <input type="text" class="input" name="name" placeholder="登录账号" data-validate="required:请填写账号,length#>=5:账号长度不符合要求"/>
	                	<div id="searchusername"></div>
	                </div>
	            </div>
	            <div class="form-group">
	            	<div class="label"><label for="title">密码</label></div>
	                <div class="field field-icon-right">
	                    <input type="password" class="input" name="password" placeholder="登录密码" data-validate="required:请填写密码,length#>=5:密码长度不符合要求" />
	                </div>
	            </div>
	            <div class="form-group">
	            	<div class="label"><label for="title">确认密码</label></div>
	                <div class="field field-icon-right">
	                    <input type="password" class="input" name="repassword" placeholder="确认密码" data-validate="required:请填写确认密码,length#>=5:密码长度不符合要求"/>
	                	<div id="repassword"></div>
	                </div>
	            </div>
	            <div class="form-group">
	            	<div class="label"><label for="title">手机号</label></div>
	                <div class="field field-icon-right">
	                    <input type="text" class="input" name="tel" placeholder="为了找回密码" data-validate="required:请填写手机号,number:你们家的手机号不是数字吗！？" />
	                </div>
	            </div>
	            <div class="form-group">
	            	<div class="label"><label for="title">邮箱地址</label></div>
	                <div class="field field-icon-right">
	                    <input type="text" class="input" name="email" placeholder="为了找回密码" />
	                </div>
	            </div>
	            <div class="form-group">
	            	<div class="label"><label for="title">默认收货地址</label></div>
	                <div class="field field-icon-right">
	                    <input type="text" class="input" name="address" placeholder="默认收货地址" />
	                </div>
	            </div>
	            <div class="form-button"><button type="sumbit" class="button bg-main" >提交</button></div>
			</div>
        </form>
        </div>
        <div class="tab-panel" id="tab-email">
        	<div id="ajaxpagedata"></div>
        	<div id="ajaxpagehtml">
				<button onclick="ajaxpage(1)">点击我获取数据</button>        	
        	</div>
      </div>
    </div>
    <p class="text-right text-gray"><a class="text-gray" href="#"><?php echo C('version');?></a></p>
</div>

</body>
</html>